From: Ihor Radchenko Date: Fri, 3 May 2024 07:46:22 +0000 (+0300) Subject: mhtml-mode: Use `run-mode-hook' to run `prog-mode-hook' (bug#70671) X-Git-Tag: archive/raspbian/1%30.1+1-3+rpi1^2~14^2~18^2~1671 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=15c77f2fce418983147346589158e2f0da97fa43;p=emacs.git mhtml-mode: Use `run-mode-hook' to run `prog-mode-hook' (bug#70671) * lisp/textmodes/mhtml-mode.el (mhtml-mode): When running hooks simulating inheritance from `prog-mode', use `run-mode-hooks' that honors `delay-mode-hooks' macro. Note that `delay-mode-hooks' is bound to non-nil when major mode body is evaluated, so there is no chance that any major mode-related hooks are executed twice. --- diff --git a/lisp/textmodes/mhtml-mode.el b/lisp/textmodes/mhtml-mode.el index 0b5c6756ab9..e2de6959dc6 100644 --- a/lisp/textmodes/mhtml-mode.el +++ b/lisp/textmodes/mhtml-mode.el @@ -359,7 +359,7 @@ the rules from `css-mode'." (add-hook 'before-change-functions #'c-foreign-truncate-lit-pos-cache nil t) ;; This is sort of a prog-mode as well as a text mode. - (run-hooks 'prog-mode-hook)) + (run-mode-hooks 'prog-mode-hook)) (put 'mhtml-mode 'flyspell-mode-predicate #'mhtml--flyspell-check-word)